import request from '@/utils/request'
// 任务回访接口

// 回访任务查询全部
export function callBackTaskList() {
  return request({
    url: '/call-center/api/v1/callBackTask/',
    method: 'get'
  })
}
// 回访任务新增
export function callBackTaskAdd(data) {
  return request({
    url: '/call-center/api/v1/callBackTask',
    method: 'post',
    data: data
  })
}
// 回访任务新增并返回id
export function callBackTaskAddGetId(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/add',
    method: 'post',
    data: data
  })
}
// 批量新增任务对象
export function callBackTaskAddBatchObj(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/addBatch/object',
    method: 'post',
    data: data
  })
}
// 批量更新任务对象
export function callBackTaskUpdateBatchObj(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/updateBatch/object',
    method: 'put',
    data: data
  })
}
// 获取执行坐席组
export function callBackTaskGetStaffInfo(id) {
  return request({
    url: '/call-center/api/v1/callBackTask/getStaffInfo?taskId=' + id,
    method: 'get'
  })
}
// 任务分配
export function callBackTaskAllocation(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/allocation',
    method: 'post',
    data: data
  })
}

// 提交任务回访处理情况
export function callBackTaskCommit(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/commit',
    method: 'put',
    data: data
  })
}

// 提交问卷内容
export function commitQuestionnaire(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/commitQuestionnaire',
    method: 'post',
    data: data
  })
}
// 回访任务修改
export function callBackTaskUpdate(data) {
  return request({
    url: '/call-center/api/v1/callBackTask',
    method: 'put',
    data: data
  })
}
// 回访任务详情
export function callBackTaskDetail(id) {
  return request({
    url: '/call-center/api/v1/callBackTask/' + id,
    method: 'get'
  })
}
// 回访任务删除
export function callBackTaskDelete(id) {
  return request({
    url: '/call-center/api/v1/callBackTask/' + id,
    method: 'delete'
  })
}
// 回访任务删除批量
export function callBackTaskDeleteBatch(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/deleteBatch',
    method: 'delete',
    data
  })
}
// 导入回访客户信息
export function callBackTaskUpload(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/upload',
    method: 'delete',
    data
  })
}

// 回访类型查询全部
export function callBackTaskTypeList() {
  return request({
    url: '/call-center/api/v1/callBackTask/type',
    method: 'get'
  })
}

// 回访类型查询分页
export function callBackTaskTypeListPage(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/type/page',
    method: 'post',
    data
  })
}
// 回访类型新增
export function callBackTaskTypeAdd(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/type',
    method: 'post',
    data: data
  })
}
// 回访类型修改
export function callBackTaskTypeUpdate(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/type',
    method: 'put',
    data: data
  })
}
// 回访类型删除
export function callBackTaskTypeDelete(id) {
  return request({
    url: '/call-center/api/v1/callBackTask/type/' + id,
    method: 'delete'
  })
}
// 回访类型删除批量
export function callBackTaskTypeDeleteBatch(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/type',
    method: 'delete',
    data
  })
}

// 导入订单回访任务查询(不分页)
export function callBackTaskImport() {
  return request({
    url: '/call-center/api/v1/callBackTask/import',
    method: 'get'
  })
}
// 导入客户回访任务分页查询
export function callBackTaskImportPage(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/import/page',
    method: 'post',
    data
  })
}
// 导入客户回访结果分页查询
export function callBackTaskImportResultPage(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/importResult/page',
    method: 'post',
    data
  })
}
// 根据ID查询导入回访任务详情
export function callBackTaskImportDetail(id) {
  return request({
    url: '/call-center/api/v1/callBackTask/import/' + id,
    method: 'get'
  })
}

// 线下订单回访任务查询(不分页)
export function callBackTaskOffline() {
  return request({
    url: '/call-center/api/v1/callBackTask/offline',
    method: 'get'
  })
}
// 线下订单回访任务分页查询
export function callBackTaskOfflinePage(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/offline/page',
    method: 'post',
    data
  })
}
// 根据ID查询线下订单回访任务详情
export function callBackTaskOfflineDetail(id) {
  return request({
    url: '/call-center/api/v1/callBackTask/offline/' + id,
    method: 'get'
  })
}
// 线下订单筛选
export function callBackTaskOfflineTop() {
  return request({
    url: '/call-center/api/v1/callBackTask/offline/top',
    method: 'get'
  })
}

// 线上订单回访任务查询(不分页)
export function callBackTaskOnline() {
  return request({
    url: '/call-center/api/v1/callBackTask/offline',
    method: 'get'
  })
}
// 线上订单回访任务分页查询
export function callBackTaskOnlinePage(data) {
  return request({
    url: '/call-center/api/v1/callBackTask/online/page',
    method: 'post',
    data
  })
}
// 根据ID查询线上订单回访任务详情
export function callBackTaskOnlineDetail(id) {
  return request({
    url: '/call-center/api/v1/callBackTask/online/' + id,
    method: 'get'
  })
}
// 线上订单筛选
export function callBackTaskOnlineTop() {
  return request({
    url: '/call-center/api/v1/callBackTask/online/msc',
    method: 'get'
  })
}
// 模板下载
export function callBackTaskDownload() {
  return request({
    url: '/call-center/api/v1/callBackTask/download',
    method: 'get',
    responseType: 'blob'
  })
}
/**
 * 获取虚拟号
 * @param {*} data
 * @returns
 */
export function getVirtualPhone(objectId) {
  return request({
    url: `/call-center/api/v1/virtualNumber/${objectId}`,
    menthod: 'GET'
  })
}

/**
 * 获取工单简要信息
 * @param {*} data
 * @returns
 */
export function workOrderRecordSimple(data) {
  return request({
    url: `/call-center/api/v2/workOrderRecord/simple/page`,
    method: 'POST',
    data
  })
}
